Log in Register Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

cody's Profile Picture

cody

4270 Files

633435 Views

Latest files of /cody/swapnilsparsh/30DaysOfJavaScript/186 - Picture in Picture

favicon.png cody/swapnilsparsh/30DaysOfJavaScript/186 - Picture in Picture/favicon.png
89 Views
0 Comments
Media file
style.css cody/swapnilsparsh/30DaysOfJavaScript/186 - Picture in Picture/style.css
102 Views
0 Comments
@import url("https://fonts.googleapis.com/css?family=Barlow&display=swap");

html {
box-sizing: border-box;
}

body {
margin: 0;
index.html cody/swapnilsparsh/30DaysOfJavaScript/186 - Picture in Picture/index.html
291 Views
0 Comments
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Picture in Picture</title>
<link rel="icon" type="image/png" href="favicon.png">
<link rel="stylesheet" href="style.css">
script.js cody/swapnilsparsh/30DaysOfJavaScript/186 - Picture in Picture/script.js
176 Views
0 Comments
const videoElement = document.getElementById('video');
const button = document.getElementById('button');

// Prompt to select media stream, pass to video element, then play
async function selectMediaStream() {
try {
const mediaStream = await navigator.mediaDevices.getDisplayMedia();
videoElement.srcObject = mediaStream;